<%@ page language="java" import="java.util.*,com.opensymphony.xwork2.util.*" pageEncoding="UTF-8"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="json" uri="http://www.atg.com/taglibs/json" %> 



<!doctype html>
<html lang="zh-hans">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">


<link rel="stylesheet" href="../lib/bootstrap/css/bootstrap.min.css">
<link href="../lib/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<link rel="stylesheet" href="../css/style.css">
<link rel="stylesheet" href="../css/main.css">    

<script type="text/javascript" src="../lib/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../lib/bootstrap/js/bootstrap.min.js"></script>

<script src="../lib/dev/js/mobiscroll.core-2.5.2.js" type="text/javascript"></script>
<script src="../lib/dev/js/mobiscroll.core-2.5.2-zh.js" type="text/javascript"></script>
<link href="../lib/dev/css/mobiscroll.core-2.5.2.css" rel="stylesheet" type="text/css" />
<link href="../lib/dev/css/mobiscroll.animation-2.5.2.css" rel="stylesheet" type="text/css" />
<script src="../lib/dev/js/mobiscroll.datetime-2.5.1.js" type="text/javascript"></script>
<script src="../lib/dev/js/mobiscroll.datetime-2.5.1-zh.js" type="text/javascript"></script>



<title>HIFO</title>
 <style type="text/css">
        .current a {
            font-size: 20px;
        }
        .over {
            display: none;
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: #f5f5f5;
            opacity:0.5;
            z-index: 1000;
        }
        .layout {
            display: none;
            position: absolute;
            top: 40%;
            left: 40%;
            width: 20%;
            height: 20%;
            z-index: 1001;
            text-align:center;
        }
 </style>
   

<script type="text/javascript">
function loading(isShow)
        {
            if(isShow){
            document.getElementById("over").style.display = "block";
            document.getElementById("layout").style.display = "block";
            }else{
             document.getElementById("over").style.display = "none";
             document.getElementById("layout").style.display = "none";
            }
 }


$(function () {
var currYear = (new Date()).getFullYear();	
var opt={};
opt.date = {preset : 'date'};
//opt.datetime = { preset : 'datetime', minDate: new Date(2012,3,10,9,22), maxDate: new Date(2014,7,30,15,44), stepMinute: 5  };
opt.datetime = {preset : 'datetime'};
opt.time = {preset : 'time'};
opt.default = {
theme: 'android-ics light', //皮肤样式
display: 'modal', //显示方式 
mode: 'scroller', //日期选择模式
lang:'zh',
startYear:currYear - 10, //开始年份
endYear:currYear + 10 //结束年份
};
$("#appDate").val('').scroller('destroy').scroller($.extend(opt['date'], opt['default']));
var optDateTime = $.extend(opt['datetime'], opt['default']);
var optTime = $.extend(opt['time'], opt['default']);
$("#appDateTime").mobiscroll(optDateTime).datetime(optDateTime);
$("#appTime").mobiscroll(optTime).time(optTime);

});

function tijiao(){
	//$("#opType").val(2);
	$("#date").val($("#appDate").val());	
	document.form1.submit();
};

<%
ValueStack vs=(ValueStack)request.getAttribute("struts.valueStack");
String myjson=(String)vs.findValue("jsonData");
%>
var jsonstr=<%=myjson%>

</script>
</head>
<body>    

<div id="over" class="over"></div>
<div id="layout" class="layout"><img src="../images/load.gif" alt="" /></div>

  
<div class="container">

<!-- 选择时间 -->



<form name="form1" action="ad_check" method="post">
<div class="btn-group btn-group-lg" role="group" aria-label="Large button group">
      <span><input type="text" class="form-control" name="date" id="appDate"  /></span>
      <span><input type="text" class="form-control" name="_date" id="_date" value="<s:property value="date"/>" disabled="disabled" /></span>
      <!--<button type="button" class="btn btn-default"><s:property value="date"/></button>  -->
      <button type="button" class="btn btn-default"><button type="button" class="btn btn-primary" onClick="tijiao()">查询</button></button>
</div>
</form>



    
     
     
<div class="bs-example" data-example-id="simple-responsive-table">
<div class="table-responsive">
<table class="table table-hover table-condensed">
<thead>
<tr>
<th width="5%"></th>
<th>时间</th>
<th>姓名</th>
<th>部门</th>
<th>省份</th>
<th>市区</th>
<th width="32%"></th>
<th></th>
<th></th>
</tr>
</thead>
<tbody>

<!-- 
	private String name,dep,province,city,address,photo;
	private Integer type,id,state;
	<s:property value="#st.index"/>
 -->

<s:iterator value="dataList" id="data" status="index">
<tr class="success" onclick="a(this)">
<td class="active" width="50"><s:property value="#index.index+1"/></td>
<td class="active" width="50"><s:property value="#data.time.toString().substring(11,16)"/></td>
<td class="active" width="50"><s:property value="#data.name"/></td>
<td class="active" width="50">
<s:if test='#data.dep=="x"'>
	无</s:if><s:elseif test='#data.dep=="a"'>集团</s:elseif><s:elseif test='#data.dep=="b"'>汇发</s:elseif>
	<s:elseif test='#data.dep=="c"'>合锦</s:elseif><s:elseif test='#data.dep=="d"'>恒安</s:elseif>
</td>
<td class="active" width="50"><s:property value="#data.province"/></td>
<td class="active" width="50"><s:property value="#data.city"/></td>
<td class="active" width="50"><s:property value="#data.address"/></td>
<td class="active" width="50">
	<s:if test='#data.type==1'>
	打卡</s:if><s:else>行动
	</s:else>
</td>
<td class="active" width="50">
<s:if test='#data.state==0'>未审核</s:if><s:elseif test='#data.state==1'>通过</s:elseif>
<s:elseif test='#data.state==2'>不符合</s:elseif>
<s:elseif test='#data.state==3'>重复</s:elseif><s:elseif test='#data.state==4'>无法查看</s:elseif>
<s:else>未知状态</s:else>
</td>

</tr>
</s:iterator>


<!--  
<tr class="success" onclick="a(this)">
<th scope="row">1</th>
<td>2016-03-08 20:09</td>
<td>刘德华</td>
<td>汇发</td>
<td>四川</td>
<td>绵阳</td>
<td>打卡</td>
<td>四川省南充市顺庆区和平路街道万兴街18号</td>
<td>&bull;&radic;&Chi;?+</td>

</tr>-->



</tbody>
</table>
</div><!-- /.table-responsive -->           
     
     
</div>		


<!-- 模态框中的表单  -->
<!-- 隐藏数据域 -->


																															<!-- 模态框数据副本测试用 -->
<div class="row">
<div class="col-xs-6"></div>
<div class="col-xs-6"></div>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
  <div class="modal-dialog" role="document">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="myModalLabel">HIFO</h4>
      </div>
      <div class="modal-body">
        
        
<div class="input-group hide">
	<input type="text" class="form-control" id="_id" name="_id" placeholder="id" value="">
	<input type="text" class="form-control" id="_type" name="_type" placeholder="_type" value="">
	<input type="text" class="form-control" id="_name" name="_name" placeholder="_name" value="">
</div>

  
 <a id="_picture" class="btn btn-primary btn-sm" href="#" target="_blank" role="button">图片查看</a>
 
 <!-- 行动描述 -->
  <div class="input-group">
    <div class="input-group-addon"><img class="home" src="../images/memo.png"></div>
    <textarea class="form-control" rows="3" cols="6" name="_memo" id="_memo" disabled="disabled"></textarea>
    <div class="col-xs-12" id="_tip"></div>
  </div>
 
  
 <div id="_radio1"> 
	  <input type="radio" name="_state" id="_state" value=0 checked> 0 未审核
	  <input type="radio" name="_state" id="_state" value=1 > 1 通过
	  <input type="radio" name="_state" id="_state" value=2 > 2 不符合
	  <input type="radio" name="_state" id="_state" value=3 > 3 重复
	  <input type="radio" name="_state" id="_state" value=4 > 4 无法查看
	  
  </div>

  
  <div class="input-group">
    <div class="input-group-addon"><img class="home" src="../images/memo.png"></div>
    <textarea class="form-control" rows="3" cols="6" name="checkmemo" id="_checkmemo"></textarea>
    <div class="col-xs-12" id="_tip"></div>
  </div>
         
        
        
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
        <button type="button" class="btn btn-primary" onClick="gpsCheck()">提交</button>
      </div>
    </div>
  </div>
</div>

</div> <!-- container end -->
				
				

 				
<script>
// 获取点击的行数
function a(a){
i=a.rowIndex-1;
_id=jsonstr[i].id;
_type=jsonstr[i].type;
_name=jsonstr[i].name;
_picture="http://we.51waji.com/picture/"+jsonstr[i].path+"/"+jsonstr[i].photo

$('#_id').val(_id);
$('#_type').val(_type);
$('#_name').val(_name);
$('#_memo').html(jsonstr[i].memo);
$('#_checkmemo').html(jsonstr[i].checkmemo);

$("#_picture").attr("href",_picture); 
//jcb=client_json[i].clientBase;
//jce=client_json[i].clientExtend;
//alert(i+"-"+jsonstr[i].name);
//alert(client_json[i].clientBase);
//loading(1);
//$('#client-base').html(jcb);
//$('#client-extend').html(jce);
$('#myModal').modal('show');
//$('#cid').val(client_json[i].cid);
}

//移除点击的tr样式
$(function(){
$('table tr').click(function(){
$(this).removeClass();
})

});                    

function gpsCheck(){
loading(1);
check();
}


//ajax 进行审核
function check(){ 	//check phone
	 $.ajax({ url:"gpscheck",
	 		data:{id:$("#_id").val(),type:$("#_type").val(),checkmemo:$("#_checkmemo").val(),checked:$('#_radio1 input[name="_state"]:checked ').val()}, 
	 		type:'post',
	        success: function(obj){
	        	$("input[name='_state']").get(0).checked=true; 
	        	setTimeout('loading(0)',3000);
	        	$("#_tip").html(obj.tip);
	        	if(obj.resultState<0){	//出现错误
	        		
	   			 	$("#_tip").html(obj.tip);
	   			 	
	   			 }
	   			
}});   
}
               
</script>









    
    
  
        




</body>
</html>